package com.data.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间处理
 *
 * @author:HingLo
 * @create 2017-09-30 17:10
 **/
public class DateUtils {

    public static Date stringToDate(String date) {
        if (!CheckDataUtils.stringUtils(date)) {
            date = "2017-01-01";
        }

        SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd");
        try {
            return format.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
            return new Date();
        }
    }

}
